package com.example.take_out_dish.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.take_out_admin_api.AdminClient;
import com.example.take_out_dish.common.Result;
import com.example.take_out_dish.entity.Category;
import com.example.take_out_dish.entity.Dish;
import com.example.take_out_dish.exceptions.BusinessException;
import com.example.take_out_dish.exceptions.enumetation.ResponseEnum;
import com.example.take_out_dish.service.CategoryService;
import com.example.take_out_dish.service.DishService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {

    @Resource
    private AdminClient adminClient;

    @GetMapping
    public Result test() {
        String token = "123eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiYWRtaW4iLCJyb2xlIjoiIiwiYWRtaW5JZCI6IjEiLCJpYXQiOjE3MjAxODQwOTEsImV4cCI6MTcyMDE4NzY5MX0.AnKt3aIyJ3rqli4KqsPfW_y7w44pJ-UfUQ05STki9mk";
        boolean b = adminClient.validateToken(token);
        log.info("token:{}, isValuable:{}", token, b);
        return Result.success();
    }

}
